package homework_03;

import java.util.Scanner;

/**
 * 求正整数n的阶乘（!5=1*2*3*4*5）
 */
public class Test_15 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个正整数：");
        int n = sc.nextInt();
        int fn = 1;
        int m = 0;
        while(n>0){
            m = n;
            n--;
            fn *= m;
        }
        System.out.println("该数字的阶乘为" + fn);
    }
}
